package foodmaterial.dao;

import foodmaterial.dto.CustomerInfoDto;
import foodmaterial.dto.MealsTypeDto;
import foodmaterial.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CustomerDao {

    int insertRouterInfo(RouterInfo routerInfo);
    int updateRouterInfo(RouterInfo routerInfo);
    List<RouterInfo> selectRouterInfo(RouterInfo routerInfo) ;

    int insertSupplyType(SupplyType supplyType);
    int updateSupplyType(SupplyType supplyType);
    List<SupplyType> selectSupplyType(SupplyType supplyType) ;

    int insertSupplyTeam(SupplyTeam supplyTeam);
    int updateSupplyTeam(SupplyTeam supplyTeam);
    List<SupplyTeam> selectSupplyTeam(SupplyTeam supplyTeam) ;

    int insertSupplyArea(SupplyArea supplyArea);
    int updateSupplyArea(SupplyArea supplyArea);
    List<SupplyArea> selectSupplyArea(SupplyArea supplyArea) ;

    List<CustomerInfo> selectCustomerRoot() ;
    int insertCustomerInfo(CustomerInfo customerInfo);
    int batchInsertCustomerInfo(List<CustomerInfo> list) ;
    int updateCustomerInfo(CustomerInfo customerInfo);
    int updateCustomerInfoOrder(List<CustomerInfo> customerInfos);
    int stopCustomer(CustomerInfo customerInfo) ;
    List<CustomerInfo> selectCustomerInfo(CustomerInfoDto dto) ;
    List<CustomerInfo> selectCustomerInfoByType(List<String> params) ;
    List<CustomerInfo> selectCustomerInfoByIds(List<Long> ids) ;
    List<String> selectDriver() ;

    int insertMealsType(MealsType mealsType) ;
    int batchInsertMealsType(List<MealsType> data);
    int updateMealsType(MealsType mealsType) ;
    int deleteMealsType(MealsType mealsType) ;
    List<MealsType> selectMealsType(MealsTypeDto dto) ;
    List<MealsType> selectRecipeVipMealsType(MealsTypeDto dto) ;
    List<MealsType> selectCustomerToTeam(Map<String,Object> params) ;

    int insertMealsTypeName(MealsTypeName mealsTypeName) ;
    int updateMealsTypeName(MealsTypeName mealsTypeName) ;
    int updateMealsTypeNameOrderAndCalType(List<MealsTypeName> data) ;
    int deleteMealsTypeName(MealsTypeName mealsTypeName) ;
    List<MealsTypeName> selectMealsTypeName(MealsTypeName mealsTypeName) ;
    List<String> selectMealsTypeCalName();

    int insertCustomerFoodMaterialSupplier(List<CustomerFoodMaterialSupplier> data) ;
    int deleteCustomerFoodMaterialSupplier(@Param("customerIds") List<Long> customerIds,
                                           @Param("foodMaterialId") Long foodMaterialId) ;
    List<CustomerFoodMaterialSupplier> selectCustomerFoodMaterialSupplier(CustomerFoodMaterialSupplier customerFoodMaterialSupplier) ;

    int checkCustomer() ;

    void truncateCustomer() ;
    void truncateRouter() ;
    void truncateSupplyType() ;
    void truncateSupplyTeam() ;
    void truncateSupplyArea() ;

}
